#include <iostream>
#include "Complex.h"
#include "Student.h"
using namespace std;

int main()
{

    //创建对象时向构造函数传参
    // Student stu("小明", 15, 92.5f);
    // stu.show();
    // //创建对象时向构造函数传参
    // Student *pstu = new Student("李华", 16, 96);
    // pstu -> show();

    Complex a1(1.0, 2.0);
    cout << a1.getImage() << endl;
    cout << a1.getReal() << endl;

    Complex a2(1.0, 2.0);

    Complex c2;

    c2 = a1 + a2;

    cout << c2 << endl;

    // Complex b1(1.0, 2.0);

    // cout << (a1 + b1).getImage() << endl;
    // cout << (a1 + b1).getReal() << endl;

    printf("Hello World\nWelcome to go to C++\n");

    int i = 4;
    int* ip = &i;
    cout << (*ip) << endl;

    double d = 3.14;
    double* dp = &d;
    cout << (*dp) << endl;
    
    // 指针的数组 array of points    T* t[]  int* a[4]
    // 数组的指针 a point to array   T(*t)[] int(*b)[4] 

    int c[4] = {1, 2, 3, 4};
    int * a[4];
    int(*b)[4];

    b = &c; // 数组个数得匹配
    for (unsigned int i = 0; i < 4; i ++) {
        a[i] = &(c[i]);
    }

    cout << (*(a[0])) << endl;
    cout << ((*b)[3]) << endl;

    // const point 与 point const
    // 关于const 修饰的部分
    char strHelloworld[] = {"helloworld"};
    char const *pStr1 = "helloworld"; // 修饰char char 不能变 但是指针可以变
    // char* const pStr2 = "helloworld";
    // char const* const pStr3 = "helloworld";
    pStr1 = strHelloworld;
    //pStr2 = strHellowlrd;
    //pStr3 = strHellowlrd;
    //关于const修饰的部分:
    //1.看左侧最近的部分
    //2.如果左侧没有，则看右侧

    int f = 3;
    int* ap = &f;
    int** app = &ap;

}